package cn.zwxky.android.staff.Follow;

import android.content.Context;
import android.view.View;

import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;

import java.util.List;

import cn.zwxky.android.staff.R;
import cn.zwxky.android.staff.Utils.URLString;

/**
 * Created by Administrator on 2017/4/5 0005.
 */

public class TaskListAdapter extends CommonRecycAdapter<TaskListBean.ListBean>{


    public TaskListAdapter(Context context, List<TaskListBean.ListBean> list, int layoutId) {
        super(context, list, layoutId);
    }

    @Override
    public void convert(ViewHolderRecyc holder, final TaskListBean.ListBean model) {
        holder.setImg(R.id.aty_img_head, URLString.IMG_URL+model.getImg(), R.mipmap.img_my_details_head);
        holder.setText(R.id.aty_text_name, model.getName());
        holder.setText(R.id.aty_text_phone, model.getTel());
        holder.setText(R.id.aty_text_gongsi, model.getCompany());
        holder.setText(R.id.aty_text_title, model.getProname());
        holder.setText(R.id.aty_text_beizhu, model.getContent());
        holder.setText(R.id.aty_text_type, model.getCla_name());

        holder.setOnclick(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                TaskLstClickEvent even = new TaskLstClickEvent();
                even.setData(model.getId());
                LsfbEvent.getInstantiation().post(even);
            }
        });
    }
}
